/*
* ---------------------------------------------------------------------
* Copyright (c) 2014, 2015 All Right Reserved
* This software is developed for study and improve coding skill ...
*
* Project:  Excellent Coding < EC >
* 
* ecLog.h
* This file for all log output hreader file define.
* Eamil:  epengao@126.com
* Author: Peter Gao
* Version: First initinal version.
* --------------------------------------------------------------------
*/

#ifndef EC_LOG_H
#define EC_LOG_H

#ifdef __cplusplus
extern "C" {
#endif

#include <stdio.h>

namespace ec {

#define __EC_LOGI(format, ...)                                  \
    do                                                          \
    {                                                           \
        printf("EC_Info: %s %s %d " format "\n",                \
              __FILE__, __FUNCTION__, __LINE__, ##__VA_ARGS__ );\
    } while (0)

#define __EC_LOGW(format, ...)                                  \
    do                                                          \
    {                                                           \
        printf("EC_Waring: %s %s %d " format "\n",              \
              __FILE__, __FUNCTION__, __LINE__, ##__VA_ARGS__ );\
    } while (0)

#define __EC_LOGE(format, ...)                                  \
    do                                                          \
    {                                                           \
        printf("EC_Error: %s %s %d " format "\n",               \
              __FILE__, __FUNCTION__, __LINE__, ##__VA_ARGS__ );\
    } while (0)

/* EC used log macro define */
#define EC_LOGI  __EC_LOGI
#define EC_LOGW  __EC_LOGW
#define EC_LOGE  __EC_LOGE
} /* namespace ec */
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* EC_LOG_H */
